#! /usr/bin/python

import re, string, sys
import pepe.p_txt.bigtxt as bt

def cntFreq(infile_s, column_n, delimiter_s):
    freq_h = {}
    for line_s in bt.lines(infile_s):
        cols_l = string.split(line_s, delimiter_s)
        if freq_h.get(cols_l[column_n]):
            freq_h[cols_l[column_n]] += 1
        else:
            freq_h[cols_l[column_n]] = 1
    return freq_h

def prnFreq(in_h, prn_limit_n, delimiter_s):
    for key in sorted(in_h.keys()):
        if in_h[key] > prn_limit_n:
            print string.join([key,
                               str(in_h[key])
                               ],delimiter_s)
    
#cntFreq('testdata.dat', 1, '^')
#prnFreq('testdata.dat', 1, '^')
